// part1:C10:ex10.24.cpp
// use bind adn check_size, to find length of a string from vector<string>,whichlength longer than input string.
#include_<iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include "make_plural.h"
using namespace std;
using namespace std::placeholders;

bool check_size(const string& s, string::size_type sz) {
  return s.size() <= sz;
}

void biggies(vector<int>& vc, const string& s) {
  auto p = find_if(vc.begin(), vc.end(),
                   bind(check_size, s, _1));
  cout << "first " << p - vc.begin() + 1 << " length " << *p
       << " longer than " << s << " is :" << endl;
}

int main(int argc, char *argv[1]) {
  vector<int> vc = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  biggies(vc, "Hello");
  biggies(vc,"everyone");
  biggies(vc, "!");

  return 0;
}
